UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PwC6oI46v/aSJ4cBbMJYY7knRdI1MYb1q6uGN38wY5Q='
WHERE
key_id = 'dfdd9a4bdcc6bb2a0849b1bdcd6072c201cd1b26e72cede957e5caf2fefd7a77'
AND (
token = 'PwC6oI46v/aSJ4cBbMJYY7knRdI1MYb1q6uGN38wY5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)