UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3AcX5y/96fpylUFNQU/w0XOV9Uhgi59K2CUl8UFrrsA='
WHERE
key_id = 'cc5b39fb164f104a06f0d4efaab71bbcecd0a938e4ffba0eecbc9ce72ae36593'
AND (
token = '3AcX5y/96fpylUFNQU/w0XOV9Uhgi59K2CUl8UFrrsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)