UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GykHF3KW3PaZViZdVpexYfW6NkbBtx/KuQdCdyBbUUo=' 
WHERE 
  key_id = '75e7f8e9c6c82dac767544a21fb5267472981fdd1738f1bdb64d73ad24b5efcc' 
  AND (
    token = 'GykHF3KW3PaZViZdVpexYfW6NkbBtx/KuQdCdyBbUUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037