UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IRVsdvmb7H01o1olWqUGVjtHlnECyd4pCwf93aNmqSI='
WHERE
key_id = 'e5fd685d1d2f1a0ed0e4985fc49a6af8addc5da2a9e973fbb1617ab69dc9703c'
AND (
token = 'IRVsdvmb7H01o1olWqUGVjtHlnECyd4pCwf93aNmqSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)