UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k3bJNG37xSxpxCHe4cnCkkFsKQhNknWwFmp7CRvFqeo=' 
WHERE 
  key_id = '8e45d6537c23e3a8d85a2ba86d531d8dbbf73377ed13ad3e57ce5d4ec239b366' 
  AND (
    token = 'k3bJNG37xSxpxCHe4cnCkkFsKQhNknWwFmp7CRvFqeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032