UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gH5KFOVqsi6IXy7VU5u1i6YF8jS/OwLTat/QD1meGiw='
WHERE
key_id = 'f75ff20e9c6778b699301995807b3ca577fd51a9739ea6119adda1db4b3a3779'
AND (
token = 'gH5KFOVqsi6IXy7VU5u1i6YF8jS/OwLTat/QD1meGiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)