UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SNpcpnn9sDRpkfdYo0Kd4Isgqq/F/cNpNjix45LeeXE='
WHERE
key_id = 'eb70d59f1823f113d82659b203160286cad6217042c6beca196e0b0d91a9e7bc'
AND (
token = 'SNpcpnn9sDRpkfdYo0Kd4Isgqq/F/cNpNjix45LeeXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)