UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PvQYnB8Ljv1Wk69NOHqXvS87YAPBzYFhoPY39Spp73w='
WHERE
key_id = '1426d9f67b2376a2cdcff9b1c567d312fd341a3aa8a0c539d8a4dd7762c0fbfd'
AND (
token = 'PvQYnB8Ljv1Wk69NOHqXvS87YAPBzYFhoPY39Spp73w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)