UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBHSE961acvVwPVQe6zLj9p8XNbD0wHT24VYl3a1yxY='
WHERE
key_id = '701c223912dcc127f2b05481cd0464613ad817290b241159b39469d995476813'
AND (
token = 'JBHSE961acvVwPVQe6zLj9p8XNbD0wHT24VYl3a1yxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)