UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFGRYGrq9WNOK5Jpg0pmRpH295bGgSuNaZAqgZreq+A='
WHERE
key_id = '2b3e55929c5d66ca81e283cfc62de0a979d9b201d22f29347a386d1b54930bd1'
AND (
token = 'bFGRYGrq9WNOK5Jpg0pmRpH295bGgSuNaZAqgZreq+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)