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