UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iC1wP34v0gqK/DUoc8bDTCcKSGspWRua/yIOTRdqsDQ=' 
WHERE 
  key_id = 'a8fd263b2cb17cf3418a620f2ea63b2d560242dd6fd5df942b553e1f75df8ee6' 
  AND (
    token = 'iC1wP34v0gqK/DUoc8bDTCcKSGspWRua/yIOTRdqsDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030