UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LZf0yAAPtA8DoP2Q2FoBL/u7WUskbxMKTdG4/Z3aXpY=' 
WHERE 
  key_id = '85195c03371efede192dcf839583be4ac6f60b700f99dd275173ed5b682fa7d6' 
  AND (
    token = 'LZf0yAAPtA8DoP2Q2FoBL/u7WUskbxMKTdG4/Z3aXpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023