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