UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/Ihy/br1F8koniFbFCp02zh769qeGELHWsKvZXhNIE=' 
WHERE 
  key_id = 'f82ba15dcf55e5490d8d835d41cb0851e8abd3e7a6957565d02ad864055709ef' 
  AND (
    token = '7/Ihy/br1F8koniFbFCp02zh769qeGELHWsKvZXhNIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025