UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6SlH2G1Zeb+n6FveANB1kKO076tVa1GaFUZwZ7xjGxM=' 
WHERE 
  key_id = '63522be8aa31f7dbc215c79a1c54cb03fc63c42d7644d80663c211ad30c55017' 
  AND (
    token = '6SlH2G1Zeb+n6FveANB1kKO076tVa1GaFUZwZ7xjGxM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039