UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iEernxuZvEKC4iLrPJX3damOPdai5dAG5KA7udKiZ78='
WHERE
key_id = '843ea9f5fca999aefe74f05bc8b7cda9df7cc24225bcdce85f37e6c2a6806a52'
AND (
token = 'iEernxuZvEKC4iLrPJX3damOPdai5dAG5KA7udKiZ78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)