UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AYZVOfE/vITTTfoH8w6Hs2b5QLWnWhHUl8Rn5QrG+QE='
WHERE
key_id = 'ecfd09e6707375aed7233ecf65c172c2180889df1d2d572d7bd1118de19d603a'
AND (
token = 'AYZVOfE/vITTTfoH8w6Hs2b5QLWnWhHUl8Rn5QrG+QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)