UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+jZ2hCw2k9E3dVPpYwURYu7aq+0xeLa2byPeddvyAc='
WHERE
key_id = 'ba11c7ff6dbae6dea7006b1dec635a2f0ef1d732cebde179627951fe0915b8e2'
AND (
token = 'U+jZ2hCw2k9E3dVPpYwURYu7aq+0xeLa2byPeddvyAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)