UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sanUynbb9kyOUzZxCjt+58o064NnvzQ6iGuvjNm2xd8='
WHERE
key_id = 'b9824d5f65d3ea391d09d029a644ce8704e1c28e1aa8c270527cd9423e754c57'
AND (
token = 'sanUynbb9kyOUzZxCjt+58o064NnvzQ6iGuvjNm2xd8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)