UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '19XiTgqhzaSZUKqxGi9WyPE2kdOByW4O70gwgkd4PO0=' 
WHERE 
  key_id = 'b2717cf74197f57059851791bae5f6656ebc44a47aeac660f1d9bf25d2811df3' 
  AND (
    token = '19XiTgqhzaSZUKqxGi9WyPE2kdOByW4O70gwgkd4PO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067