UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fBB82hvQLyeRjVblelsbOO1IXo2Bz3PyCpGi/R3S9mM='
WHERE
key_id = 'e317418d07d4a4bb1d3a6cb1ebfcc5bd73e8771a032924cb124e2e7d9e4f9ec2'
AND (
token = 'fBB82hvQLyeRjVblelsbOO1IXo2Bz3PyCpGi/R3S9mM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)