UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A+V+nYbqY0KIdiVoaHnEeD1uy4ZnDyqWN2brhurvtnA='
WHERE
key_id = '9bdf2e2837248dfad53c416d08a9d0b32d626117b2902af05966d8d8e27b485a'
AND (
token = 'A+V+nYbqY0KIdiVoaHnEeD1uy4ZnDyqWN2brhurvtnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)