UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h5zfJS6EncmK2FuVj+r7b0Qc093UMKpaiP0Fci2h8UU=' 
WHERE 
  key_id = 'ca093cceda46f0730b5410461c24b5e09c45450f38483fe4f54bb047486c54fd' 
  AND (
    token = 'h5zfJS6EncmK2FuVj+r7b0Qc093UMKpaiP0Fci2h8UU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035