UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qfap8vqxwEsz1W3miknrjkJmoO38rlGLWSGDck/IZ28=' 
WHERE 
  key_id = '5e167ced5ccac47ea29bc41b1c4f85c80531f81b5f8b1fbb0e6a990061c654b4' 
  AND (
    token = 'Qfap8vqxwEsz1W3miknrjkJmoO38rlGLWSGDck/IZ28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024