UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V10s4XFbHFXocrHWLk2P5cDuQ2SCSm+P9KnQ/TD8mrY='
WHERE
key_id = '979f1b7a56df5b4f3689e0d3450b56ef95e5d7a5d16bce0615f3d6a630723248'
AND (
token = 'V10s4XFbHFXocrHWLk2P5cDuQ2SCSm+P9KnQ/TD8mrY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)