UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5t3PQ2Z7ncB0VsbAm0PPs74NoOvt99jCU+XqAgQYtnY=' 
WHERE 
  key_id = '79712a187a7e69bf64554c7e7c977e98937b96391c29eb11f8bc84110b9b7879' 
  AND (
    token = '5t3PQ2Z7ncB0VsbAm0PPs74NoOvt99jCU+XqAgQYtnY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040