UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YkzslwsQOzK2YSrnE2w1B9Qpte6iYzMXR9R69pkS1dY=' 
WHERE 
  key_id = 'f2fec5234c6f887fb9ce687e9269ebe3476c19612b7598b1401d54d6f1873c80' 
  AND (
    token = 'YkzslwsQOzK2YSrnE2w1B9Qpte6iYzMXR9R69pkS1dY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041