UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yfesYk5fFD7kAJ47g5JQfafTRAuy6dUMqpGR/Zm7yeU=' 
WHERE 
  key_id = '46aed3ff15c0035c9304e0be7b1df9d2727f2bedc02ce1062f96ab0869faa5d3' 
  AND (
    token = 'yfesYk5fFD7kAJ47g5JQfafTRAuy6dUMqpGR/Zm7yeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035