UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZi3645n0tG9J6mxRKXC/3cBzmNgHijo9ioouBcudhQ='
WHERE
key_id = 'e6c5aa084d0e6ef9a72d6c4dff4ff53dac01d17f0c6ec4b5eb36298129a6f201'
AND (
token = 'xZi3645n0tG9J6mxRKXC/3cBzmNgHijo9ioouBcudhQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)