UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wpUpv6RhSsopB9IBGO2S5Ssu1+XQVpdl+a0MRfpeVcg=' 
WHERE 
  key_id = 'b541936be3ec8cc4308f47ac92e49736b945f2559af067a060162ac5c834b2c4' 
  AND (
    token = 'wpUpv6RhSsopB9IBGO2S5Ssu1+XQVpdl+a0MRfpeVcg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019