UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lRLbjayooHOMfGAvKzlbSczYv/O1aorXFDEfuMmoIfA='
WHERE
key_id = '0f2a006db759db76050d839d2b0888af74576e7d4fcf9e84071945cd53d1d2c3'
AND (
token = 'lRLbjayooHOMfGAvKzlbSczYv/O1aorXFDEfuMmoIfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)