UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kqr+mMLv1yRVZSQuTkBePdWiZRzMhg0c/HVcack/R8g=' 
WHERE 
  key_id = '5509f9d076305efc7114a6de595c04dae9ea76c9b1df6c5a50075a24c42878d0' 
  AND (
    token = 'Kqr+mMLv1yRVZSQuTkBePdWiZRzMhg0c/HVcack/R8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032